package eva.savant.businessobject.gl;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;

@Table(name="GL_NIT")
@javax.persistence.Entity(name = "gl.Nit")
public class Nit {

    @Id
    @Column(name = "ID_NIT", length = 15, nullable = false)
    private String id; //ID Numero NIT

    @Basic
    @Column(name = "RAZON", length = 50, nullable = false)
    private String razon; //Razon Social

    @Basic
    @Column(name = "OPERACION_ID", length = 10, nullable = false)
    private Integer operacionId; //Operacion ID

    @Basic @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "FECHA_ID", length = 19, nullable = false)
    private Date fechaId; //Fecha Proceso ID


    public Nit(String id, String razon, Integer operacionId) {

        this.id= id;

        this.razon= razon;

        this.operacionId= operacionId;

    }

    public Nit() {

    }


    public String getId() {
    
        return id;
    }
    
    public void setId(String id) {
    
        this.id = id;
    }

    public String getRazon() {
    
        return razon;
    }
    
    public void setRazon(String razon) {
    
        this.razon = razon;
    }

    public Integer getOperacionId() {
    
        return operacionId;
    }
    
    public void setOperacionId(Integer operacionId) {
    
        this.operacionId = operacionId;
    }

    @PreUpdate
    @PrePersist
    public void updateTimeFechaId() {

        this.fechaId = new Timestamp(new java.util.Date().getTime());
    }

}
